package world;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;




/**
 * Holds information on platforms, starting point and goal (enemies?)
 * @author Anders
 */
public class Level 
{
	
	private List<world.Platform> platforms;
	public Level()
	{
		platforms = new ArrayList<Platform>();
	}
	
	public boolean collidesWith(Rectangle objBounds)
	{
		boolean collides = false;
		int index = 0;
		while(!collides && index < platforms.size()) {
			Platform p = platforms.get(index);
			if(p.getBounds().intersects(objBounds)) {
				collides = true;
			}
			else {
				index++;
			}
		}
		
		return collides;
	}
	
	public void addPlatform(Platform p) 
	{
		platforms.add(p);
	}
	
	public List<Platform> getPlatforms()
	{
		return platforms;
	}
}
